/*
 * @Author       : liuzehai
 * @Date         : 2021-2-20 11:54:31
 * @LastEditors: limit
 * @LastEditTime: 2021-07-21 15:11:05
 * @FilePath: /sim-card-platform/src/api/commodity.js
 * @Description  : 商品管理接口定义；测试
 */
import request from '@/utils/request';

// 获取当前人的部门数据
function getcurrentTree() {
    return request({
        url: `drug/dept/currentTree`,
        method: 'get',
    })
}
// 租户列表
function gettenantList(query) {
    return request({
        url: `drug/tenant/list`,
        method: 'get',
        params: query
    })
}
// 新增租户
function addtenant(data) {
    return request({
        url: 'drug/tenant/save',
        method: 'POST',
        data
    });
}
// 切换租户启用状态
function switchTenant(id) {
    return request({
        url: 'drug/tenant/' + id,
        method: 'put',
    })
}
// 修改租户
function updateTenant(data) {
    return request({
        url: `drug/tenant`,
        method: 'put',
        data
    })
}
//删除租户
function deletetenant(id) {
    return request({
        url: 'drug/tenant/' + id,
        method: 'delete',
    })
}
// 日志分页查询
function getlogList(query) {
    return request({
        url: `drug/log/list`,
        method: 'get',
        params: query
    })
}
//删除日志
function deletelog(id) {
    return request({
        url: 'drug/log/delete/' + id,
        method: 'delete',
    })
}
//批量删除日志
function batchDelete(data) {
    return request({
        url: 'drug/log/batchDelete',
        method: 'delete',
        data
    })
}

// 导出商品管理相关模块
export default {
    getcurrentTree,
    gettenantList,
    addtenant,
    switchTenant,
    updateTenant,
    deletetenant,
    getlogList,
    deletelog,
    batchDelete,
}